﻿<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:converters='clr-namespace:Shazzam.Converters'
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             x:Class="Shazzam.Controls.AdjustableSlider"
             mc:Ignorable="d" >
    <UserControl.Resources>
        <converters:DoubleToStringConverter x:Key='doubleConverter' />
    </UserControl.Resources>
    <WrapPanel Margin='0,3'
               x:Name="mainPanel"
               Background='{StaticResource VeryDarkBrush}'>
        <StackPanel Orientation='Horizontal'
                    Margin='5,0,0,0'
                    MinWidth="290">
            <TextBlock Foreground='{StaticResource HighlightBrush}'
                       Width='12'
                       VerticalAlignment='Center'
                       Text='͏'
                       TextAlignment="Center"
                       Margin="0" />
            <TextBlock Foreground='{StaticResource NeutralWhiteBrush}'
                       Margin='5,0,0,0'
                       VerticalAlignment='Center'
                       Text='Min:' />
            <TextBox x:Name='minTextBox'
                     Margin='5,0,0,0'
                     VerticalAlignment='Center'
                     Width='40'
                     Text='0' />
            <TextBlock Foreground='{StaticResource NeutralWhiteBrush}'
                       Margin='5,0,0,0'
                       VerticalAlignment='Center'
                       Text='Max:' />
            <TextBox x:Name='maxTextBox'
                     Margin='5,0,0,0'
                     VerticalAlignment='Center'
                     Width='40'
                     Text='100' />
            <TextBlock Foreground='{StaticResource NeutralWhiteBrush}'
                       Margin='5,0,0,0'
                       VerticalAlignment='Center'
                       Text='Value:' />
            <TextBlock x:Name='sliderText'
                       Foreground='{StaticResource NeutralWhiteBrush}'
                       VerticalAlignment='Center'
                       Margin='5,0,0,0'
                       Width='90'
                       Text='{Binding ElementName=slider, Path=Value,StringFormat=F2}'
                       Visibility='Collapsed' />
            <Slider x:Name='slider'
                    Margin='5,0,0,0'
                    Minimum='{Binding Text, ElementName=minTextBox}'
                    Maximum='{Binding Text, ElementName=maxTextBox}'
                    AutoToolTipPlacement='TopLeft'
                    AutoToolTipPrecision='3'
                    IsMoveToPointEnabled='True'
                    Width='90'
                    ToolTip='{Binding Value, Converter={StaticResource doubleConverter}, RelativeSource={RelativeSource Self}}'
                    VerticalAlignment="Center" />
      
    </StackPanel>
        <Rectangle Fill='{StaticResource NeutralDarkBrush}'
                   Width='1'
                   Margin='0,3,-1,3'
                   SnapsToDevicePixels='True' />
        <StackPanel VerticalAlignment='Center'>
            <StackPanel Orientation='Horizontal'
                        Margin='5,3,5,3'>
                <TextBlock Foreground='{StaticResource NeutralWhiteBrush}'
                           VerticalAlignment='Center'
                           Text='Animation:'
                           MinWidth="55" />
                <ToggleButton x:Name='noAnimationToggleButton'
                              IsChecked='True'
                              ToolTip='None'
                              Width='22'
                              Height='22'
                              Margin='5,0,0,0'
                              VerticalAlignment='Center'>
                    <Rectangle Width='16'
                               Height='16'
                               Fill='{StaticResource NoAnimationIconBrush}' />
                </ToggleButton>
                <ToggleButton x:Name='linearAnimationToggleButton'
                              ToolTip='Linear'
                              Width='22'
                              Height='22'
                              Margin='5,0,0,0'
                              VerticalAlignment='Center'>
                    <Rectangle Width='16'
                               Height='16'
                               Fill='{StaticResource HorizontalAnimationIconBrush}' />
                </ToggleButton>
            </StackPanel>
            <StackPanel Orientation='Horizontal'
                        Margin='5,3,5,3'>
                <TextBlock Foreground='{StaticResource NeutralWhiteBrush}'
                           VerticalAlignment='Center'
                           Text='Duration:'
                           MinWidth="55" />
                <TextBox x:Name='durationTextBox'
                         Margin='5,0,0,0'
                         VerticalAlignment='Center'
                         MinWidth='40'
                         Text='0.5' />
                <TextBlock Foreground='{StaticResource NeutralWhiteBrush}'
                           Margin='5,0,0,0'
                           VerticalAlignment='Center'
                           Text='seconds' />
            </StackPanel>
        </StackPanel>
    </WrapPanel>
</UserControl>
